package com.sq.subject.application.controller;

import com.sq.subject.infra.basic.entity.UserInfo;
import com.sq.subject.infra.rpc.UserRpc;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @author quan
 */
@RestController
@Slf4j
public class FeignTestController {

    @Resource
    private UserRpc userRpc;

    @RequestMapping("/userInfo")
    public UserInfo getUserInfo(HttpServletRequest request) {
        String loginId = request.getHeader("loginId");
        log.info("FeignTestController.getUserInfo.loginId:{}",loginId);
        return userRpc.getUserInfo("邓娜");
    }

}
